(0) Obligation:

Clauses:

ordered([]).
ordered(.(X, [])).
ordered(.(X, .(Y, Xs))) :- ','(le(X, Y), ordered(.(Y, Xs))).
le(s(X), s(Y)) :- le(X, Y).
le(0, s(0)).
le(0, 0).

Query: ordered(g)

(1) PrologToPrologProblemTransformerProof (SOUND transformation)

Built Prolog problem from termination graph ICLP10.

(2) Obligation:

Clauses:

leA(s(T33), s(T34)) :- leA(T33, T34).
leA(0, s(0)).
leA(0, 0).
orderedB([]).
orderedB(.(T3, [])).
orderedB(.(s(T19), .(s(T20), T10))) :- leA(T19, T20).
orderedB(.(s(T19), .(s(T20), T10))) :- ','(leA(T19, T20), orderedB(.(s(T20), T10))).
orderedB(.(0, .(s(0), T10))) :- orderedB(.(s(0), T10)).
orderedB(.(0, .(0, T10))) :- orderedB(.(0, T10)).

Query: orderedB(g)

(3) PrologToPiTRSProof (SOUND transformation)

We use the technique of [TOCL09]. With regard to the inferred argument filtering the predicates were used in the following modes:
orderedB_in: (b)
leA_in: (b,b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

orderedB_in_g([]) → orderedB_out_g([])
orderedB_in_g(.(T3, [])) → orderedB_out_g(.(T3, []))
orderedB_in_g(.(s(T19), .(s(T20), T10))) → U2_g(T19, T20, T10, leA_in_gg(T19, T20))
leA_in_gg(s(T33), s(T34)) → U1_gg(T33, T34, leA_in_gg(T33, T34))
leA_in_gg(0, s(0)) → leA_out_gg(0, s(0))
leA_in_gg(0, 0) → leA_out_gg(0, 0)
U1_gg(T33, T34, leA_out_gg(T33, T34)) → leA_out_gg(s(T33), s(T34))
U2_g(T19, T20, T10, leA_out_gg(T19, T20)) → orderedB_out_g(.(s(T19), .(s(T20), T10)))
U2_g(T19, T20, T10, leA_out_gg(T19, T20)) → U3_g(T19, T20, T10, orderedB_in_g(.(s(T20), T10)))
orderedB_in_g(.(0, .(s(0), T10))) → U4_g(T10, orderedB_in_g(.(s(0), T10)))
orderedB_in_g(.(0, .(0, T10))) → U5_g(T10, orderedB_in_g(.(0, T10)))
U5_g(T10, orderedB_out_g(.(0, T10))) → orderedB_out_g(.(0, .(0, T10)))
U4_g(T10, orderedB_out_g(.(s(0), T10))) → orderedB_out_g(.(0, .(s(0), T10)))
U3_g(T19, T20, T10, orderedB_out_g(.(s(T20), T10))) → orderedB_out_g(.(s(T19), .(s(T20), T10)))

Pi is empty.

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(4) Obligation:

Pi-finite rewrite system:
The TRS R consists of the following rules:

orderedB_in_g([]) → orderedB_out_g([])
orderedB_in_g(.(T3, [])) → orderedB_out_g(.(T3, []))
orderedB_in_g(.(s(T19), .(s(T20), T10))) → U2_g(T19, T20, T10, leA_in_gg(T19, T20))
leA_in_gg(s(T33), s(T34)) → U1_gg(T33, T34, leA_in_gg(T33, T34))
leA_in_gg(0, s(0)) → leA_out_gg(0, s(0))
leA_in_gg(0, 0) → leA_out_gg(0, 0)
U1_gg(T33, T34, leA_out_gg(T33, T34)) → leA_out_gg(s(T33), s(T34))
U2_g(T19, T20, T10, leA_out_gg(T19, T20)) → orderedB_out_g(.(s(T19), .(s(T20), T10)))
U2_g(T19, T20, T10, leA_out_gg(T19, T20)) → U3_g(T19, T20, T10, orderedB_in_g(.(s(T20), T10)))
orderedB_in_g(.(0, .(s(0), T10))) → U4_g(T10, orderedB_in_g(.(s(0), T10)))
orderedB_in_g(.(0, .(0, T10))) → U5_g(T10, orderedB_in_g(.(0, T10)))
U5_g(T10, orderedB_out_g(.(0, T10))) → orderedB_out_g(.(0, .(0, T10)))
U4_g(T10, orderedB_out_g(.(s(0), T10))) → orderedB_out_g(.(0, .(s(0), T10)))
U3_g(T19, T20, T10, orderedB_out_g(.(s(T20), T10))) → orderedB_out_g(.(s(T19), .(s(T20), T10)))

Pi is empty.

(5) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

ORDEREDB_IN_G(.(s(T19), .(s(T20), T10))) → U2_G(T19, T20, T10, leA_in_gg(T19, T20))
ORDEREDB_IN_G(.(s(T19), .(s(T20), T10))) → LEA_IN_GG(T19, T20)
LEA_IN_GG(s(T33), s(T34)) → U1_GG(T33, T34, leA_in_gg(T33, T34))
LEA_IN_GG(s(T33), s(T34)) → LEA_IN_GG(T33, T34)
U2_G(T19, T20, T10, leA_out_gg(T19, T20)) → U3_G(T19, T20, T10, orderedB_in_g(.(s(T20), T10)))
U2_G(T19, T20, T10, leA_out_gg(T19, T20)) → ORDEREDB_IN_G(.(s(T20), T10))
ORDEREDB_IN_G(.(0, .(s(0), T10))) → U4_G(T10, orderedB_in_g(.(s(0), T10)))
ORDEREDB_IN_G(.(0, .(s(0), T10))) → ORDEREDB_IN_G(.(s(0), T10))
ORDEREDB_IN_G(.(0, .(0, T10))) → U5_G(T10, orderedB_in_g(.(0, T10)))
ORDEREDB_IN_G(.(0, .(0, T10))) → ORDEREDB_IN_G(.(0, T10))

The TRS R consists of the following rules:

orderedB_in_g([]) → orderedB_out_g([])
orderedB_in_g(.(T3, [])) → orderedB_out_g(.(T3, []))
orderedB_in_g(.(s(T19), .(s(T20), T10))) → U2_g(T19, T20, T10, leA_in_gg(T19, T20))
leA_in_gg(s(T33), s(T34)) → U1_gg(T33, T34, leA_in_gg(T33, T34))
leA_in_gg(0, s(0)) → leA_out_gg(0, s(0))
leA_in_gg(0, 0) → leA_out_gg(0, 0)
U1_gg(T33, T34, leA_out_gg(T33, T34)) → leA_out_gg(s(T33), s(T34))
U2_g(T19, T20, T10, leA_out_gg(T19, T20)) → orderedB_out_g(.(s(T19), .(s(T20), T10)))
U2_g(T19, T20, T10, leA_out_gg(T19, T20)) → U3_g(T19, T20, T10, orderedB_in_g(.(s(T20), T10)))
orderedB_in_g(.(0, .(s(0), T10))) → U4_g(T10, orderedB_in_g(.(s(0), T10)))
orderedB_in_g(.(0, .(0, T10))) → U5_g(T10, orderedB_in_g(.(0, T10)))
U5_g(T10, orderedB_out_g(.(0, T10))) → orderedB_out_g(.(0, .(0, T10)))
U4_g(T10, orderedB_out_g(.(s(0), T10))) → orderedB_out_g(.(0, .(s(0), T10)))
U3_g(T19, T20, T10, orderedB_out_g(.(s(T20), T10))) → orderedB_out_g(.(s(T19), .(s(T20), T10)))

Pi is empty.
We have to consider all (P,R,Pi)-chains

(6) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

ORDEREDB_IN_G(.(s(T19), .(s(T20), T10))) → U2_G(T19, T20, T10, leA_in_gg(T19, T20))
ORDEREDB_IN_G(.(s(T19), .(s(T20), T10))) → LEA_IN_GG(T19, T20)
LEA_IN_GG(s(T33), s(T34)) → U1_GG(T33, T34, leA_in_gg(T33, T34))
LEA_IN_GG(s(T33), s(T34)) → LEA_IN_GG(T33, T34)
U2_G(T19, T20, T10, leA_out_gg(T19, T20)) → U3_G(T19, T20, T10, orderedB_in_g(.(s(T20), T10)))
U2_G(T19, T20, T10, leA_out_gg(T19, T20)) → ORDEREDB_IN_G(.(s(T20), T10))
ORDEREDB_IN_G(.(0, .(s(0), T10))) → U4_G(T10, orderedB_in_g(.(s(0), T10)))
ORDEREDB_IN_G(.(0, .(s(0), T10))) → ORDEREDB_IN_G(.(s(0), T10))
ORDEREDB_IN_G(.(0, .(0, T10))) → U5_G(T10, orderedB_in_g(.(0, T10)))
ORDEREDB_IN_G(.(0, .(0, T10))) → ORDEREDB_IN_G(.(0, T10))

The TRS R consists of the following rules:

orderedB_in_g([]) → orderedB_out_g([])
orderedB_in_g(.(T3, [])) → orderedB_out_g(.(T3, []))
orderedB_in_g(.(s(T19), .(s(T20), T10))) → U2_g(T19, T20, T10, leA_in_gg(T19, T20))
leA_in_gg(s(T33), s(T34)) → U1_gg(T33, T34, leA_in_gg(T33, T34))
leA_in_gg(0, s(0)) → leA_out_gg(0, s(0))
leA_in_gg(0, 0) → leA_out_gg(0, 0)
U1_gg(T33, T34, leA_out_gg(T33, T34)) → leA_out_gg(s(T33), s(T34))
U2_g(T19, T20, T10, leA_out_gg(T19, T20)) → orderedB_out_g(.(s(T19), .(s(T20), T10)))
U2_g(T19, T20, T10, leA_out_gg(T19, T20)) → U3_g(T19, T20, T10, orderedB_in_g(.(s(T20), T10)))
orderedB_in_g(.(0, .(s(0), T10))) → U4_g(T10, orderedB_in_g(.(s(0), T10)))
orderedB_in_g(.(0, .(0, T10))) → U5_g(T10, orderedB_in_g(.(0, T10)))
U5_g(T10, orderedB_out_g(.(0, T10))) → orderedB_out_g(.(0, .(0, T10)))
U4_g(T10, orderedB_out_g(.(s(0), T10))) → orderedB_out_g(.(0, .(s(0), T10)))
U3_g(T19, T20, T10, orderedB_out_g(.(s(T20), T10))) → orderedB_out_g(.(s(T19), .(s(T20), T10)))

Pi is empty.
We have to consider all (P,R,Pi)-chains

(7) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 3 SCCs with 6 less nodes.

(8) Complex Obligation (AND)

(9) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

LEA_IN_GG(s(T33), s(T34)) → LEA_IN_GG(T33, T34)

The TRS R consists of the following rules:

orderedB_in_g([]) → orderedB_out_g([])
orderedB_in_g(.(T3, [])) → orderedB_out_g(.(T3, []))
orderedB_in_g(.(s(T19), .(s(T20), T10))) → U2_g(T19, T20, T10, leA_in_gg(T19, T20))
leA_in_gg(s(T33), s(T34)) → U1_gg(T33, T34, leA_in_gg(T33, T34))
leA_in_gg(0, s(0)) → leA_out_gg(0, s(0))
leA_in_gg(0, 0) → leA_out_gg(0, 0)
U1_gg(T33, T34, leA_out_gg(T33, T34)) → leA_out_gg(s(T33), s(T34))
U2_g(T19, T20, T10, leA_out_gg(T19, T20)) → orderedB_out_g(.(s(T19), .(s(T20), T10)))
U2_g(T19, T20, T10, leA_out_gg(T19, T20)) → U3_g(T19, T20, T10, orderedB_in_g(.(s(T20), T10)))
orderedB_in_g(.(0, .(s(0), T10))) → U4_g(T10, orderedB_in_g(.(s(0), T10)))
orderedB_in_g(.(0, .(0, T10))) → U5_g(T10, orderedB_in_g(.(0, T10)))
U5_g(T10, orderedB_out_g(.(0, T10))) → orderedB_out_g(.(0, .(0, T10)))
U4_g(T10, orderedB_out_g(.(s(0), T10))) → orderedB_out_g(.(0, .(s(0), T10)))
U3_g(T19, T20, T10, orderedB_out_g(.(s(T20), T10))) → orderedB_out_g(.(s(T19), .(s(T20), T10)))

Pi is empty.
We have to consider all (P,R,Pi)-chains

(10) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(11) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

LEA_IN_GG(s(T33), s(T34)) → LEA_IN_GG(T33, T34)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains

(12) PiDPToQDPProof (EQUIVALENT transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(13) Obligation:

Q DP problem:
The TRS P consists of the following rules:

LEA_IN_GG(s(T33), s(T34)) → LEA_IN_GG(T33, T34)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(14) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • LEA_IN_GG(s(T33), s(T34)) → LEA_IN_GG(T33, T34)
    The graph contains the following edges 1 > 1, 2 > 2

(15) YES

(16) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

U2_G(T19, T20, T10, leA_out_gg(T19, T20)) → ORDEREDB_IN_G(.(s(T20), T10))
ORDEREDB_IN_G(.(s(T19), .(s(T20), T10))) → U2_G(T19, T20, T10, leA_in_gg(T19, T20))

The TRS R consists of the following rules:

orderedB_in_g([]) → orderedB_out_g([])
orderedB_in_g(.(T3, [])) → orderedB_out_g(.(T3, []))
orderedB_in_g(.(s(T19), .(s(T20), T10))) → U2_g(T19, T20, T10, leA_in_gg(T19, T20))
leA_in_gg(s(T33), s(T34)) → U1_gg(T33, T34, leA_in_gg(T33, T34))
leA_in_gg(0, s(0)) → leA_out_gg(0, s(0))
leA_in_gg(0, 0) → leA_out_gg(0, 0)
U1_gg(T33, T34, leA_out_gg(T33, T34)) → leA_out_gg(s(T33), s(T34))
U2_g(T19, T20, T10, leA_out_gg(T19, T20)) → orderedB_out_g(.(s(T19), .(s(T20), T10)))
U2_g(T19, T20, T10, leA_out_gg(T19, T20)) → U3_g(T19, T20, T10, orderedB_in_g(.(s(T20), T10)))
orderedB_in_g(.(0, .(s(0), T10))) → U4_g(T10, orderedB_in_g(.(s(0), T10)))
orderedB_in_g(.(0, .(0, T10))) → U5_g(T10, orderedB_in_g(.(0, T10)))
U5_g(T10, orderedB_out_g(.(0, T10))) → orderedB_out_g(.(0, .(0, T10)))
U4_g(T10, orderedB_out_g(.(s(0), T10))) → orderedB_out_g(.(0, .(s(0), T10)))
U3_g(T19, T20, T10, orderedB_out_g(.(s(T20), T10))) → orderedB_out_g(.(s(T19), .(s(T20), T10)))

Pi is empty.
We have to consider all (P,R,Pi)-chains

(17) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(18) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

U2_G(T19, T20, T10, leA_out_gg(T19, T20)) → ORDEREDB_IN_G(.(s(T20), T10))
ORDEREDB_IN_G(.(s(T19), .(s(T20), T10))) → U2_G(T19, T20, T10, leA_in_gg(T19, T20))

The TRS R consists of the following rules:

leA_in_gg(s(T33), s(T34)) → U1_gg(T33, T34, leA_in_gg(T33, T34))
leA_in_gg(0, s(0)) → leA_out_gg(0, s(0))
leA_in_gg(0, 0) → leA_out_gg(0, 0)
U1_gg(T33, T34, leA_out_gg(T33, T34)) → leA_out_gg(s(T33), s(T34))

Pi is empty.
We have to consider all (P,R,Pi)-chains

(19) PiDPToQDPProof (EQUIVALENT transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(20) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U2_G(T19, T20, T10, leA_out_gg(T19, T20)) → ORDEREDB_IN_G(.(s(T20), T10))
ORDEREDB_IN_G(.(s(T19), .(s(T20), T10))) → U2_G(T19, T20, T10, leA_in_gg(T19, T20))

The TRS R consists of the following rules:

leA_in_gg(s(T33), s(T34)) → U1_gg(T33, T34, leA_in_gg(T33, T34))
leA_in_gg(0, s(0)) → leA_out_gg(0, s(0))
leA_in_gg(0, 0) → leA_out_gg(0, 0)
U1_gg(T33, T34, leA_out_gg(T33, T34)) → leA_out_gg(s(T33), s(T34))

The set Q consists of the following terms:

leA_in_gg(x0, x1)
U1_gg(x0, x1, x2)

We have to consider all (P,Q,R)-chains.

(21) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

ORDEREDB_IN_G(.(s(T19), .(s(T20), T10))) → U2_G(T19, T20, T10, leA_in_gg(T19, T20))


Used ordering: Polynomial interpretation [POLO]:

POL(.(x1, x2)) = 1 + x1 + x2   
POL(0) = 0   
POL(ORDEREDB_IN_G(x1)) = 2·x1   
POL(U1_gg(x1, x2, x3)) = 2·x1 + 2·x2 + x3   
POL(U2_G(x1, x2, x3, x4)) = 2 + x1 + 2·x2 + 2·x3 + x4   
POL(leA_in_gg(x1, x2)) = 2·x1 + 2·x2   
POL(leA_out_gg(x1, x2)) = 2·x1 + 2·x2   
POL(s(x1)) = 2·x1   

(22) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U2_G(T19, T20, T10, leA_out_gg(T19, T20)) → ORDEREDB_IN_G(.(s(T20), T10))

The TRS R consists of the following rules:

leA_in_gg(s(T33), s(T34)) → U1_gg(T33, T34, leA_in_gg(T33, T34))
leA_in_gg(0, s(0)) → leA_out_gg(0, s(0))
leA_in_gg(0, 0) → leA_out_gg(0, 0)
U1_gg(T33, T34, leA_out_gg(T33, T34)) → leA_out_gg(s(T33), s(T34))

The set Q consists of the following terms:

leA_in_gg(x0, x1)
U1_gg(x0, x1, x2)

We have to consider all (P,Q,R)-chains.

(23) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 1 less node.

(24) TRUE

(25) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

ORDEREDB_IN_G(.(0, .(0, T10))) → ORDEREDB_IN_G(.(0, T10))

The TRS R consists of the following rules:

orderedB_in_g([]) → orderedB_out_g([])
orderedB_in_g(.(T3, [])) → orderedB_out_g(.(T3, []))
orderedB_in_g(.(s(T19), .(s(T20), T10))) → U2_g(T19, T20, T10, leA_in_gg(T19, T20))
leA_in_gg(s(T33), s(T34)) → U1_gg(T33, T34, leA_in_gg(T33, T34))
leA_in_gg(0, s(0)) → leA_out_gg(0, s(0))
leA_in_gg(0, 0) → leA_out_gg(0, 0)
U1_gg(T33, T34, leA_out_gg(T33, T34)) → leA_out_gg(s(T33), s(T34))
U2_g(T19, T20, T10, leA_out_gg(T19, T20)) → orderedB_out_g(.(s(T19), .(s(T20), T10)))
U2_g(T19, T20, T10, leA_out_gg(T19, T20)) → U3_g(T19, T20, T10, orderedB_in_g(.(s(T20), T10)))
orderedB_in_g(.(0, .(s(0), T10))) → U4_g(T10, orderedB_in_g(.(s(0), T10)))
orderedB_in_g(.(0, .(0, T10))) → U5_g(T10, orderedB_in_g(.(0, T10)))
U5_g(T10, orderedB_out_g(.(0, T10))) → orderedB_out_g(.(0, .(0, T10)))
U4_g(T10, orderedB_out_g(.(s(0), T10))) → orderedB_out_g(.(0, .(s(0), T10)))
U3_g(T19, T20, T10, orderedB_out_g(.(s(T20), T10))) → orderedB_out_g(.(s(T19), .(s(T20), T10)))

Pi is empty.
We have to consider all (P,R,Pi)-chains

(26) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(27) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

ORDEREDB_IN_G(.(0, .(0, T10))) → ORDEREDB_IN_G(.(0, T10))

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains

(28) PiDPToQDPProof (EQUIVALENT transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(29) Obligation:

Q DP problem:
The TRS P consists of the following rules:

ORDEREDB_IN_G(.(0, .(0, T10))) → ORDEREDB_IN_G(.(0, T10))

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(30) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • ORDEREDB_IN_G(.(0, .(0, T10))) → ORDEREDB_IN_G(.(0, T10))
    The graph contains the following edges 1 > 1

(31) YES